//
//  CContactMgr.h
//  wanzhaoIM
//
//  Created by liuyuantao on 15/5/21.
//  Copyright (c) 2015年 liuyuantao. All rights reserved.
//

#import <Foundation/Foundation.h>

@class CContactModel;
@interface CContactMgr : NSObject


- (BOOL)delContactWithContactId:(NSString *)contactId;
//插入联系人
-(BOOL)insetContact:(CContactModel *)contact;
//批量插入联系人
-(BOOL)batchInsertContact:(NSArray *)contactList;

-(BOOL)batchUpdateContact:(NSArray *)contactList;

- (BOOL)updateAllContactNotSelected:(NSArray *)contactList;
- (BOOL)updateSelectWithContactList:(NSArray *)contactList isSelected:(BOOL)isSelected;
- (BOOL)updateContactSelectedWithContact:(CContactModel *)contact seleceted:(BOOL)isSelected;
//删除联系人
-(BOOL)delContact:(CContactModel *)contact;
//更新联系人
-(BOOL)updateContact:(CContactModel *)contact;
//根据联系人code加载联系人
-(CContactModel *)loadContactWithUserCode:(NSString *)contactCode;
//根据联系人id加载联系人
- (CContactModel *)loadContactWithUserId:(NSString *)userId;

- (CContactModel *)loadCurContact;
//根据部门id加载联系人
-(NSArray *)loadContactByDeptID:(NSString *)departID;
- (NSString *)loadContactNameWithUserId:(NSString *)userId;
- (CContactModel *)loadNotDelContactWithUserId:(NSString *)userId;
//删除所有联系人

- (BOOL)delAllDelContact;
-(BOOL)delAllContact;
- (NSArray *)searchContactWithSeachStr:(NSString *)searchStr;

- (NSArray *)loadOftenContact;

- (BOOL)updateAllContactStatus;

- (BOOL)updateContactIsDelWithUserId:(NSString *)userId isDel:(BOOL)isDel;
- (BOOL)isAvalableContactWithUserId:(NSString *)userId;

- (BOOL)loadAllContact;
- (BOOL)isKefuContactWithUserId:(NSString *)userId;
- (BOOL)isWaibuContactWithUserId:(NSString *)userId;
//- (NSInteger)loadAllcontactCount;
- (NSInteger)loadContactCountWithDepartMentId:(NSString *)departId withUserId:(NSString *)userId;

//加载所有选中的联系人
- (NSArray *)loadAllSelectedContact;

//根据部门ID加载选中联系人的数量
- (NSInteger)loadAllSelectedCountContactWithDepId:(NSString *)depId;

-(NSArray *)loadContactUserIdAndDepIdByDeptID:(NSString *)departID;


- (void)deleAllKeFuContact;
- (NSArray *)loadKeFuList;
- (NSArray *)loadWaiBuList;
@end
